<#assign CACHE_VERSION = "v=v=1.0.7">
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>统计脚本管理</title>
    <#include "./common/resource.ftl">
    <style>
        html,body{
            height: 100%;
        }

    </style>
    <body onload="load()" class="jm-noScroll">
        <div id="script" class="script-container">
            <i-button type="primary" @click="handleOperation('add')" class="script-add">添加</i-button>
            <el-table :data="scriptData" class="script-table" border>
                <el-table-column type="index" label="序号" align="center" width="80">
                </el-table-column>
                <el-table-column
                        v-for="(item,index) in scriptColumns"
                        :key="index"
                        :prop="item.key"
                        :label="item.title"
                        align="center"
                        :width="item.width ? item.width : ''"
                ></el-table-column>
                <el-table-column label="操作" width="180" align="center">
                    <template slot-scope="scope">
                        <el-button @click="handleOperation('edit')" type="text" size="small">编辑</el-button>
                        <el-button type="text" size="small">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <script>
            vm = new Vue({
                el: "#script",
                data: {
                    scriptColumns:[
                        {
                            title: '脚本名称',
                            key: 'name',
                            align: 'center',
                        },
                        {
                            title: '说明',
                            key: 'explain',
                            align: 'center',
                        },
                        {
                            title: '文件名',
                            key: 'filename',
                            align: 'center',
                        }
                    ],//统计脚本列
                    scriptData:[
                        {
                            id:1,
                            name:"xxxx",
                            explain:"",
                            filename:"XXXX.py"
                        },{
                            id:2,
                            name:"xxxx",
                            explain:"",
                            filename:"XXXX.py"
                        }
                    ],
                    dictModel:{
                        scripitName:"",
                        explain:"",
                        fileName:""
                    }
                },
                methods: {
                    handleOperation(type){
                        console.log(type)
                        localStorage.setItem("temp",type);
                        window.open("http://localhost:59998/report/scriptEdit");
                    }
                }
            })

        </script>
    </body>
</html>
